package com.example.lowbird.lowbird.utils;

import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.ImageView;

import com.example.lowbird.lowbird.activity.GoodActivity;
import com.example.lowbird.lowbird.bean.CateRvbean;
import com.example.lowbird.lowbird.java.SHopcar;

/**
 * Created by Administrator on 2016/11/4.
 */

public class Animatorutils {


    public static void initanimation(final Context mContexgt, ImageView imageview, final SHopcar shopcar) {


        ObjectAnimator obj = ObjectAnimator.ofFloat(imageview, "RotationX", -45, 90, -30, 45, 0);

        obj.setDuration(500);

        obj.addListener(new Animator.AnimatorListener() {
            @Override
            public void onAnimationStart(Animator animation) {

            }

            @Override
            public void onAnimationEnd(Animator animation) {
                Intent intent = new Intent(mContexgt, GoodActivity.class);

                intent.putExtra("shopcar",shopcar);

                mContexgt.startActivity(intent);
            }

            @Override
            public void onAnimationCancel(Animator animation) {

            }

            @Override
    public void onAnimationRepeat(Animator animation) {

    }
});
        obj.start();
        }
}
